package com.bby;

import javax.servlet.http.Cookie;

public class CookieUtils {
    /**
     * int 根据 name 找查 Cookie
     * @return: Cookie
     * @author: 本小蛋
     * @time: 2021/8/16 11:12
     */
    public static Cookie getCookie(Cookie[] cookies,String name){
        for (Cookie cookie : cookies)if(name.equals(cookie.getName())) return cookie;
        return null;
    }
    public static String getValue(Cookie[] cookies,String name){
        for (Cookie cookie : cookies)if(name.equals(cookie.getName())) return cookie.getValue();
        return null;
    }
}
